; contains wrapper functions for assembly code

global cli
global sti
global outb
global inb
global crash
global load_CR3
global enable_paging
global get_CR2
global get_arg
global get_ESP
global set_ESP
global load_IDT

load_IDT:
	mov eax, [esp+4]
	lidt [eax]
	ret

get_arg:
	mov ecx, [esp +4]
	mov eax, [esp + eax*4 + 36]
	ret

get_CR2:
	mov eax, cr2
	ret;

enable_paging:
	mov eax, cr0
	or eax, 0x80000000
	mov cr0, eax
	ret
	
load_CR3:
	mov eax, [esp+4]
	mov cr3, eax
	ret
	
cli:
	cli
	ret

sti:
	sti
	ret

outb:
	mov eax, [esp+8]
	mov edx, [esp+4]
	out dx, al
	ret

inb:
	mov edx, [esp+4]
	in al, dx
	and eax, 0x000000ff
	ret

crash:
	jmp 0xffffffff
	ret
	

